package com.trainoo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Set;

/** 
 * <p> description here </p>
 * @author tao.zhou
 * @date 2020/6/15 15:04:00
 * @version 1.0
 */
@Controller
public class TestController {

    @Value("${my_system_code}")
    private String value;

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    @ResponseBody
    @RequestMapping("/test")
    public String testRedis(){

        Set<String> keys = redisTemplate.keys("LOMS*");
        assert keys != null;
        System.out.println(keys.size());
        System.out.println(value);
        return "200";
    }
}
